import argparse
from server.server import WSGIAPP
from eventlet import wsgi, listen
import app
if __name__ == '__main__':
    parse = argparse.ArgumentParser()
    parse.add_argument('-b', '--host', default='127.0.0.1', required=False)
    parse.add_argument('-p', '--port', default=8000, required=False, type=int)
    args = parse.parse_args()
    # 此处高可用keepalive为false，调试用不到，后面请在nginx开启
    '''
    参数描述
    :param keepalive: If set to False, disables keepalives on the server; all connections will be
                closed after serving one request.
    '''
    wsgi.server(listen((args.host,args.port)),WSGIAPP(app.sio),keepalive=True)